<include file="Public/common" />
<block name="content">
    <style>
        th,td{text-align: center;}
        .row-2{
            padding: 0px 10px;
        }

        .row-input-width{
            width: 347px!important;
        }
        .form-group{
            padding-right: 50px!important;
            width: 42%!important;
            margin-bottom: 15px!important;
        }
        .pull-right{
            margin-right: 14px!important;
        }
        .orderNo-item{
            padding-left: 28px;
        }
        .bill-time-item{
            padding-left: 14px;
        }
        .range-item{
            padding: 7px 10px;
            background-color: #eee;
        }

        .input-left{
            margin-left: -4px;
        }
        ul,li{ list-style: none; }
        ol{margin:0;}
        .jedatehms li{display: none;}
    </style>
    <div class="page-header"><h1><i class="fa fa-home"></i> 首页 &gt; 财务管理 &gt; 发票管理</h1></div>
    <div class="col-xs-12">
        <div class="tab-content">
            <div class="row" >
                <form action="{:U('bill_list',['p'=>1])}" class="form-inline "  style="margin-left:10px;" >
                    <div class="row-2" >
                        <div class="form-group">
                            <label for="open_time" class="bill-time-item">开票时间:</label>
                            <input type="text" name="start_open_time" id="start" value="<if condition="$_GET['start_open_time']">{$_GET['start_open_time']}</if>">
                            <span class="range-item input-left">至</span>
                            <input class="input-left" type="text" name="end_open_time" id="end" value="<if condition="$_GET['end_open_time']">{$_GET['end_open_time']}</if>">
                        </div>
                        <div class="form-group">
                            <label for="open_user" class="bill-time-item">开据人:</label>
                            <input type="text" name="open_user" id="open_user" value="<if condition="$_GET['open_user']">{$_GET['open_user']}</if>"/>
                        </div>
                     </div>
                    <div class="row-2" >
                        <div class="form-group">
                            <label for="order_num" class="orderNo-item">订单号:</label>
                            <input type="text" class="row-input-width" name="order_num" id="order_num" value="<if condition="$_GET['order_num']">{$_GET['order_num']}</if>">
                        </div>
                        <div class="form-group">
                            <label for="line_name">线路名称:</label>
                            <input type="text" class="row-input-width" name="line_name" id="line_name" value="<if condition="$_GET['line_name']">{$_GET['line_name']}</if>">
                        </div>
                    </div>
                    <div class="row-2">
                        <div class="form-group">
                            <label for="tourists_phone">会员手机号:</label>
                            <input type="text" class="row-input-width" name="tourists_phone" id="tourists_phone" value="<if condition="$_GET['tourists_phone']">{$_GET['tourists_phone']}</if>">
                        </div>
                        <div class="form-group">
                            <label for="receipt_rise">发票抬头:</label>
                            <input type="text" class="row-input-width" name="receipt_rise" id="receipt_rise" value="<if condition="$_GET['receipt_rise']">{$_GET['receipt_rise']}</if>">
                        </div>

                    </div>
                    <div class="col-xs-12">
                            <a href="{:U('outBillListExportExcel')}" class="btn btn-primary ">导出</a>
                            <button type="submit" class="btn btn-primary">查询</button>
                    </div>
                </form>
            </div>
        </div>

        <div class="tabbable">
  <!--           <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab">
                <li class="active"><a href="{:U('Rule/admin_user_list')}">员工列表</a></li>
                <li><a href="{:U('Rule/add_admin')}">添加员工</a></li>
            </ul> -->
            <div class="tab-content">
                <table class="table table-striped table-bordered table-hover table-condensed">
                    <tr>
                        <th>订单号</th>
                        <th>线路名称</th>
                        <th>销售价</th>
                        <th>发票代码</th>
                        <th>发票号码</th>
                        <th>发票金额</th>
                        <th>发票抬头</th>
                        <th>发票内容</th>
                        <th>开票时间</th>
                        <th>开据人</th>
                        <th>备注</th>
                    </tr>
                    <foreach name="list" item="v">
                        <tr>
                            <td>{$v['order_num']}</td>
                            <td>{$v['line_name']}</td>
                            <td>{$v['need_pay']}</td>
                            <td>{$v['receipt_code']}</td>
                            <td>{$v['receipt_num']}</td>
                            <td>{$v['receipt_amount']}</td>
                            <td>{$v['receipt_rise']}</td>
                            <td>{$v['receipt_content']}</td>
                            <td>{$v['open_time']|date='Y-m-d',###}</td>
                            <td>{$v['open_user']}</td>
                            <td>{$v['remarks']}</td>
                        </tr>
                    </foreach>
                    <tr>
                        <td colspan="12">
                            <!--分页样式-->
                            <ul class="pagination">
                                {$show}
                            </ul>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
<script src="__JS__/jedate/jedate.js"></script>
<script>
    dateFormat($('#start'), 'YYYY-MM-DD');
    dateFormat($('#end'), 'YYYY-MM-DD');

    /**
     * 绑定日期选择器
     * @param  {[obj]}    obj        [元素]
     * @param  {[string]} dateFormat [时间格式]
     */
    function dateFormat(obj, dateFormat){
        jeDate({
            dateCell: '#'+$(obj).attr('id'),
            format: dateFormat,
            isinitVal:false,
            isTime:true, //isClear:false,
            okfun:function(val){
            }
        });
    }


    function changeVisitorStatus(uid,status) {
        var operation='开通';
        if(status==0){
            operation='锁定';
        }
        //询问框
        layer.confirm('确定'+operation+'此用户吗?', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:'{:U("Visitor/changeVisitorStatusById")}',
                dataType:"json",
                type:'POST',
                cache:false,
                data:{uid:uid,status:status},
                success: function(data) {
                    layer.msg(data.msg);
                    if (data.status==1) {
                        setTimeout(function () {
                            location.reload();
                        },1500);
                    }
                }
            });
        });

    }
</script>
</block>
